package com

import com.entity.PackPath
import com.entity.PathUnionType
import com.entity.ScriptName
import com.utils.ScriptUtils
import com.utils.ScriptUtils.appConfig
import com.utils.ScriptUtils.contrastFile
import com.utils.ScriptUtils.script
import com.utils.YamlUtil
import extend.printLog

YamlUtil.loadYaml("config/config2.yml")

script.loadScript(
    ScriptName.REPLACE,
//    ScriptName.COMPRESS,
    ScriptName.GAME_EXTEND,
    ScriptName.CRC_RENAME,
//    ScriptName.EXETEND_CMD,
//    ScriptName.UPLOAD,
)
script.loadFile.invoke(
    listOf(
        PathUnionType.PathType(
            PackPath(ScriptUtils.basePath, "LayaDcc2.kts")
        )
    )
)

YamlUtil.unpackEnvId = YamlUtil.getTypeMap(YamlUtil.unpackEnvName!!)
if (YamlUtil.unpackEnvId !in 1..3) throw Exception("错误的指令")

val index = YamlUtil.unpackEnvId
val evnName = appConfig.runEnvironment()
printLog("执行环境 ${evnName.name} 环境打包")
printLog("开始打包")

contrastFile.startPack()